<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>购买广告_会员中心</title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="{$template_member_dir}static/css/base.css?version=2020011206" rel="stylesheet">
    <link href="{$template_member_dir}static/css/m.css?version=2020010705" rel="stylesheet">
    <script src="{$template_member_dir}static/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<!--top begin-->
{include file="header" /}
<!--top end-->
<div class="box member-box">
    <div class="left-col">
        {include file="left_menu" /}
    </div>
    <div class="right-col pjax-container">
        <div class="whitebg">
            <div class="tabtitle">
                <span><a href="{:url('portalmember/MemberAdv/show')}" class="tit on">购买广告</a></span>
                <span><a href="{:url('portalmember/MemberAdv/show_my')}" class="tit">我的广告</a></span>
                <span><a href="{:url('portalmember/MemberOrder/show')}" class="tit"> 支付明细</a></span>
            </div>
            <div class="tabcontent">
                <div class="base-info">
                    <div class="help-box">

                    </div>
                </div>
                <div class="base-info-content form-list">
                    <form class="target-post-form" action="{:url('portalmember/MemberAdv/buy')}" method="post" autocomplete="off">
                        <input type="hidden" name="id" value="{$info.id|default='0'}">
                        <input type="hidden" name="adv_id" value="{$info.id|default='0'}">
                        <input type="hidden" name="price" value="{$info.price|default='0'}">
                        <input type="hidden" name="member_id" value="{$member.id|default='0'}">
                        <li class="clearfix">
                            <div class="base-info-content-l"><label>广告标题：</label></div>
                            <div class="base-info-content-r ">
                                <div class="form-group"><input name="title" class="form-control" placeholder="投放广告标题"></div>
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="base-info-content-l"><label>广告图片</label></div>
                            <div class="base-info-content-r">
                                <div class="form-group">
                                    <input type="hidden" name="litpic" id="litpic" value="">
                                    <div id="litpic-show"></div>
                                    <a type="button" class="btn btn-info ajax-open" data-url="{:url('portalmember/MemberPicture/lookup',array('img_id'=>'litpic','img_html'=>'litpic-show'))}">选择图片</a>
                                    <span class="help-block">图的质量将直接影响：信息审核 和 查询排名，建议宽度：{$info.width}，高度：{$info.height}</span>
                                </div>
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="base-info-content-l"><label>链接地址：</label></div>
                            <div class="base-info-content-r ">
                                <div class="form-group"><input name="links" class="form-control" placeholder="输入完整的链接地址如：http://www.pxdr.net"></div>
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="base-info-content-l"><label>广告简介：</label></div>
                            <div class="base-info-content-r ">
                                <div class="form-group"><input name="body" class="form-control" placeholder="广告文字简介"></div>
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="base-info-content-l"><label>开始日期：</label></div>
                            <div class="base-info-content-r">
                                <div class="form-group">
                                    <input type="text" name="start_date" id="start_date" class="form-control" placeholder="选择推广开始日期." value="{$info.days|default=''}">
                                    <span class="help-block">选择推广开始时间</span>
                                </div>
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="base-info-content-l"><label>投放天数：</label></div>
                            <div class="base-info-content-r">
                                <div class="form-group">
                                    <select name="days" class="form-control buy_days">
                                        <option value="7">一周（7天）</option>
                                        <option value="15">二周（15天）</option>
                                        <option value="30">一个月（30天）</option>
                                        <option value="60">二个月（60天）</option>
                                        <option value="90">三个月（90天）</option>
                                    </select>
                                    <span class="help-block">输入推广天数</span>
                                </div>
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="base-info-content-l"><label>合计费用：</label></div>
                            <div class="base-info-content-r">
                                <div class="form-group">
                                    <span class="info_money yellow"></span>
                                    <span class="help-block">合计费用=天*单价</span>
                                </div>
                            </div>
                        </li>

                        <li class="clearfix">
                            <div class="base-info-content-l">&nbsp;</div>
                            <div class="base-info-content-r textarea">
                                <div class="form-group">
                                    <button type="submit" class="btn btn-save btn-red ajax-post" target-form="target-post-form">申请开通去支付</button>
                                </div>
                            </div>
                        </li>

                    </form>
                </div>
            </div>
        </div>
        <div class="whitebg">
            <div class="tabtitle">
                <span class="yellow">广告投放说明</span>
            </div>
            <div class="tabcontent">
                <div class="base-info">
                    <li>1. 电脑版自助推广仅限支付宝在线支付。</li>
                    <li>2. 推广支付成功后将无法退款，推广期间信息无法修改或删除。（可以修改封面图）</li>
                    <li>3. 已经投入显示的广告，在推广时间未开始前，将无法在查询列表显示。</li>
                    <li>4. 进入广告推广支付后，将自动计算折扣后的价格，以最终支付金额为准。</li>
                    <li>5. 点击“支付宝支付”并确定后，即表示您已阅读并同意以上条款。</li>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="footer" /}
<script>
    //选择计算天数*单价

    $(".buy_days").each(function () {
        get_days_money($(this));
    })

    $("body").on("change", ".buy_days", function () {
        get_days_money($(this));
    });

    function get_days_money(obj) {
        var days=obj.val();
        var price=obj.parents('form').find("input[name='price']").val();
        var money=Number(days)*Number(price);
        obj.parents('form').find(".info_money").html(money);
        log(money);
    }
    laydate.render({
        elem: '#start_date' //指定元素
    });

</script>
</body>
</html>
